Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to list plugins #2319

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add option to list plugins #2319

wants to merge 1 commit into from

Conversation

skoeva
Copy link
Contributor

@skoeva skoeva commented Sep 10, 2024

This change creates a CLI option in the backend + desktop to list all plugins, with a distinction between static/shipped plugins and user-added ones.

Fixes: #2161

Testing

Backend

  • Run make backend
  • Run cd backend && ./headlamp-server --list-plugins and ensure that the list of plugins shows up

Desktop

  • Run cd app && npm run build
  • Run cd dist/linux-unpacked && ./headlamp --list-plugins and ensure that the list of plugins shows up

@skoeva skoeva added the backend Issues related to the backend label Sep 10, 2024
@skoeva skoeva self-assigned this Sep 10, 2024
@skoeva skoeva linked an issue Sep 10, 2024 that may be closed by this pull request
Copy link

Backend Code coverage changed from 59.3% to 59.3%. Change: 0% 😃.

Copy link
Collaborator

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

I wrote a few notes about how the backend/ code is organized.

btw, Probably this option could be documented somewhere? We don't have a page for all options. The headlamp-plugin tool has them listed in its README.md. If you don't have any inspiration for this at the moment, we can document the command line arguments in a separate PR.

backend/pkg/plugins/plugins.go Outdated Show resolved Hide resolved
backend/pkg/config/config.go Outdated Show resolved Hide resolved
@illume illume requested a review from knrt10 September 11, 2024 09:41
@illume illume marked this pull request as draft September 11, 2024 11:30
@skoeva skoeva force-pushed the list-plugins-option branch 2 times, most recently from 5d19c8a to 2c966db Compare September 11, 2024 14:02
Copy link

Backend Code coverage changed from 60.1% to 60.0%. Change: -.1% 😞.

Copy link

Backend Code coverage changed from 60.1% to 60.0%. Change: -.1% 😞.

@skoeva skoeva marked this pull request as ready for review September 12, 2024 18:52
Copy link

Backend Code coverage changed from 60.1% to 60.0%. Change: -.1% 😞.

@illume
Copy link
Collaborator

illume commented Sep 13, 2024

Looks good to me. But I think we can wait for Joaquim to see if it meets his requirements before merging.

ps. To make the code coverage bot use a happy face emoji you might consider adding a test for ListPlugins(possibly using a mock for GenerateSeparatePluginPaths).

@skoeva skoeva force-pushed the list-plugins-option branch 2 times, most recently from 05b326d to 8e99e17 Compare September 13, 2024 21:03
@vyncent-t
Copy link
Contributor

was looking into this from our sync earlier this week so far so good

Copy link

Backend Code coverage changed from 60.1% to 60.4%. Change: .3% 😃.

Copy link
Collaborator

@joaquimrocha joaquimrocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works. Thanks!
Left a couple of comments to improve things.

app/electron/main.ts Outdated Show resolved Hide resolved
// If the user wants to list plugins, we don't need to start the app.
if (listPlugins) {
const staticDir = path.join(process.resourcesPath, '.plugins');
const pluginsDir = path.join(app.getPath('userData'), 'plugins');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to get this one from the plugin manager? We should always try to have one source of truth for data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried testing using PluginManager's list function, but it would break and return empty lists. I tried testing changes to checkValidPluginFolder to see if that would fix it but it caused new JS issues. I've made the other change and can continue testing with PluginManager but I seem to be hitting a wall with this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are using 3 sources of truth in this PR:

  • The backend
  • The PluginManager
  • This app module

If we want to keep the backend and plugin manager independent, I think we need ot keep those two separated. But this main module needs to be using the source from one of the others. Since the backend has a new list-plugins command, we could as well just call that from command from here and not replicate the logic we got there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this to call execSync using the backend logic

Copy link

Backend Code coverage changed from 60.1% to 60.4%. Change: .3% 😃.

Copy link
Contributor

@knrt10 knrt10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions.

backend/cmd/server.go Outdated Show resolved Hide resolved
backend/cmd/server.go Show resolved Hide resolved
backend/pkg/plugins/plugins.go Outdated Show resolved Hide resolved
backend/pkg/plugins/plugins.go Outdated Show resolved Hide resolved
backend/pkg/plugins/plugins.go Outdated Show resolved Hide resolved
backend/pkg/plugins/plugins.go Outdated Show resolved Hide resolved
backend/pkg/plugins/plugins.go Outdated Show resolved Hide resolved
@skoeva skoeva force-pushed the list-plugins-option branch 2 times, most recently from 0834cd7 to 11cde63 Compare September 20, 2024 00:25
Copy link

Backend Code coverage changed from 60.1% to 60.3%. Change: .2% 😃.

backend/pkg/plugins/plugins_test.go Outdated Show resolved Hide resolved
@@ -25,6 +25,7 @@ type Config struct {
InsecureSsl bool `koanf:"insecure-ssl"`
EnableHelm bool `koanf:"enable-helm"`
EnableDynamicClusters bool `koanf:"enable-dynamic-clusters"`
ListPlugins bool `koanf:"list-plugins"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yolossn This is not really a config option. It's rather a subcommand.
So I wonder if we shouldn't include it in the koanf config. Do you know if there's an option to modify that in koanf, or should we use the flag parsing in a different way?

// If the user wants to list plugins, we don't need to start the app.
if (listPlugins) {
const staticDir = path.join(process.resourcesPath, '.plugins');
const pluginsDir = path.join(app.getPath('userData'), 'plugins');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are using 3 sources of truth in this PR:

  • The backend
  • The PluginManager
  • This app module

If we want to keep the backend and plugin manager independent, I think we need ot keep those two separated. But this main module needs to be using the source from one of the others. Since the backend has a new list-plugins command, we could as well just call that from command from here and not replicate the logic we got there.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 29, 2024
This change creates a CLI option in the backend + desktop to list all
plugins, with a distinction between static/shipped plugins and
user-added ones.

Fixes: #2161

Signed-off-by: Evangelos Skopelitis <eskopelitis@microsoft.com>
Copy link

Backend Code coverage changed from 60.1% to 60.4%. Change: .3% 😃.

Coverage report
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:91:			ServeHTTP				71.4%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:123:			fileExists				100.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:133:			copyReplace				63.6%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:157:			baseURLReplace				100.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:185:			getOidcCallbackURL			91.7%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:212:			serveWithNoCacheHeader			33.3%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:221:			defaultKubeConfigPersistenceDir		61.5%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:249:			defaultKubeConfigPersistenceFile	75.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:262:			addPluginRoutes				54.2%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:310:			createHeadlampHandler			40.3%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:677:			parseClusterAndToken			100.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:694:			decodePayload				71.4%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:708:			getExpiryTime				75.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:717:			isTokenAboutToExpire			61.5%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:741:			refreshAndCacheNewToken			0.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:811:			OIDCTokenRefreshMiddleware		30.8%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:862:			StartHeadlampServer			66.7%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:876:			getHelmHandler				53.8%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:904:			checkHeadlampBackendToken		100.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:917:			handleClusterHelm			33.3%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:996:			handleClusterAPI			55.6%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1044:			handleClusterRequests			66.7%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1052:			getClusters				81.8%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1086:			parseCustomNameClusters			38.1%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1140:			parseClusterFromKubeConfig		78.3%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1184:			getConfig				75.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1195:			addCluster				55.6%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1305:			deleteCluster				0.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1354:			getKubeConfigPath			66.7%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1363:			handleStatelessClusterRename		50.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1377:			customNameToExtenstions			45.5%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1410:			updateCustomContextToCache		50.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1443:			getPathAndLoadKubeconfig		55.6%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1466:			renameCluster				53.1%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1529:			addClusterSetupRoute			100.0%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1551:			handleNodeDrain				45.5%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1616:			drainNode				37.5%
github.com/headlamp-k8s/headlamp/backend/cmd/headlamp.go:1666:			handleNodeDrainStatus			52.0%
github.com/headlamp-k8s/headlamp/backend/cmd/server.go:14:			main					0.0%
github.com/headlamp-k8s/headlamp/backend/cmd/stateless.go:17:			MarshalCustomObject			60.0%
github.com/headlamp-k8s/headlamp/backend/cmd/stateless.go:42:			setKeyInCache				50.0%
github.com/headlamp-k8s/headlamp/backend/cmd/stateless.go:69:			handleStatelessReq			58.1%
github.com/headlamp-k8s/headlamp/backend/cmd/stateless.go:135:			parseKubeConfig				75.0%
github.com/headlamp-k8s/headlamp/backend/cmd/stateless.go:174:			websocketConnContextKey			100.0%
github.com/headlamp-k8s/headlamp/backend/cmd/stateless.go:224:			getContextKeyForRequest			76.9%
github.com/headlamp-k8s/headlamp/backend/pkg/cache/cache.go:40:			New					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/cache/cache.go:52:			Set					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/cache/cache.go:57:			SetWithTTL				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/cache/cache.go:75:			Delete					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/cache/cache.go:85:			Get					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/cache/cache.go:102:		GetAll					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/cache/cache.go:122:		cleanUp					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/cache/cache.go:140:		UpdateTTL				88.9%
github.com/headlamp-k8s/headlamp/backend/pkg/config/config.go:41:		Validate				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/config/config.go:63:		Parse					74.4%
github.com/headlamp-k8s/headlamp/backend/pkg/config/config.go:150:		flagset					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/config/config.go:176:		defaultPluginDir			61.5%
github.com/headlamp-k8s/headlamp/backend/pkg/config/config.go:209:		GetDefaultKubeConfigPath		66.7%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/charts.go:27:			listCharts				89.5%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/charts.go:77:			ListCharts				72.7%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/handler.go:35:		NewActionConfig				87.5%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/handler.go:54:		NewHandler				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/handler.go:60:		NewHandlerWithSettings			60.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/handler.go:85:		ToRESTConfig				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/handler.go:89:		ToRawKubeConfigLoader			100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/handler.go:93:		ToDiscoveryClient			83.3%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/handler.go:109:		ToRESTMapper				71.4%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/handler.go:129:		getReleaseStatus			0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/handler.go:165:		setReleaseStatus			60.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/handler.go:188:		setReleaseStatusSilent			66.7%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:53:		getReleases				57.1%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:112:		ListRelease				68.4%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:158:		GetRelease				0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:217:		GetReleaseHistory			46.2%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:277:		UninstallRelease			55.6%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:334:		uninstallRelease			71.4%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:357:		Validate				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:362:		RollbackRelease				51.6%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:421:		rollbackRelease				75.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:453:		Validate				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:458:		handleError				0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:463:		returnResponse				71.4%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:479:		InstallRelease				72.2%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:513:		getChart				35.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:565:		installRelease				60.7%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:625:		Validate				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:630:		UpgradeRelease				60.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:666:		logActionState				75.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:687:		upgradeRelease				63.6%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:731:		Validate				0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/release.go:749:		GetActionStatus				0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:35:		createFileIfNotThere			100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:47:		lockRepositoryFile			87.5%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:68:		addRepository				61.8%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:131:		AddRepo					72.2%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:176:		createFullPath				66.7%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:184:		listRepositories			69.2%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:213:		ListRepo				58.3%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:236:		RemoveRepository			64.0%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:279:		RemoveRepo				66.7%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:291:		UpdateRepository			68.2%
github.com/headlamp-k8s/headlamp/backend/pkg/helm/repository.go:333:		UpdateRepository			81.8%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/contextStore.go:26:	NewContextStore				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/contextStore.go:35:	AddContext				23.1%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/contextStore.go:64:	GetContexts				85.7%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/contextStore.go:80:	GetContext				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/contextStore.go:90:	RemoveContext				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/contextStore.go:95:	AddContextWithKeyAndTTL			100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/contextStore.go:100:	UpdateTTL				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/file.go:14:		WriteToFile				86.7%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/file.go:48:		RemoveContextFromFile			75.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:61:	DeepCopyObject				0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:66:	DeepCopy				0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:86:	Error					0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:97:	Error					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:108:	Error					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:119:	Error					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:124:	ClientConfig				80.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:158:	RESTConfig				75.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:168:	OidcConfig				0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:186:	ProxyRequest				83.3%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:200:	ClientSetWithToken			66.7%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:214:	SourceStr				60.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:228:	SetupProxy				91.7%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:253:	AuthType				66.7%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:265:	LoadContextsFromFile			100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:278:	LoadContextsFromBase64String		100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:291:	loadContextsFromData			100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:328:	parseAndValidateConfig			90.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:353:	createContext				90.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:398:	findCluster				82.6%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:447:	findAuthInfo				86.7%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:480:	createAuthProvider			91.7%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:508:	createExecConfig			0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:539:	createExtensions			30.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:570:	createKubeContext			60.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:615:	LoadContextsFromAPIConfig		76.5%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:654:	LoadContextsFromMultipleFiles		100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:674:	splitKubeConfigPath			75.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:684:	GetInClusterContext			0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:730:	LoadAndStoreKubeConfigs			88.9%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:749:	makeDNSFriendly				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:758:	SetClusterField				83.3%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:774:	setClusterStringField			60.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:797:	setClusterBoolField			87.5%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:816:	setClusterBase64Data			87.5%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:833:	setClusterExtensions			60.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:846:	SetAuthInfoField			87.5%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:866:	setBase64Data				81.8%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:890:	setStringField				53.8%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:919:	setStringSliceField			80.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:931:	setMapStringStringSliceField		80.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:943:	setExecField				0.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/kubeconfig.go:955:	setAuthProviderField			80.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/watcher.go:16:		LoadAndWatchFiles			80.0%
github.com/headlamp-k8s/headlamp/backend/pkg/kubeconfig/watcher.go:69:		addFilesToWatcher			82.4%
github.com/headlamp-k8s/headlamp/backend/pkg/logger/logger.go:29:		Log					100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/logger/logger.go:36:		log					75.0%
github.com/headlamp-k8s/headlamp/backend/pkg/logger/logger.go:80:		SetLogFunc				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:27:		Watch					77.8%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:48:		periodicallyWatchSubfolders		75.0%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:81:		generateSeparatePluginPaths		90.0%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:102:		GeneratePluginPaths			100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:119:		ListPlugins				73.3%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:150:		pluginBasePathListForDir		86.4%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:198:		HandlePluginEvents			70.0%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:222:		PopulatePluginsCache			66.7%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:248:		HandlePluginReload			76.9%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:279:		Delete					85.7%
github.com/headlamp-k8s/headlamp/backend/pkg/plugins/plugins.go:294:		isSubdirectory				75.0%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/handler.go:46:		Validate				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/handler.go:80:		getFreePort				75.0%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/handler.go:99:		StartPortForward			50.0%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/handler.go:173:	startPortForward			61.4%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/handler.go:269:	checkIfPodIsRunning			71.4%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/handler.go:291:	Validate				100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/handler.go:304:	StopOrDeletePortForward			47.1%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/handler.go:336:	GetPortForwards				45.5%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/handler.go:358:	GetPortForwardByID			45.5%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/store.go:16:		portforwardKeyGenerator			100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/store.go:33:		portforwardstore			75.0%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/store.go:46:		stopOrDeletePortForward			69.2%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/store.go:74:		getPortForwardList			77.8%
github.com/headlamp-k8s/headlamp/backend/pkg/portforward/store.go:94:		getPortForwardByID			100.0%
github.com/headlamp-k8s/headlamp/backend/pkg/utils/utils.go:4:			Contains				100.0%
total:										(statements)				60.4%

Html coverage report download

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issues related to the backend size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have an option to list plugins
5 participants